package com.eastfair.home.service.impl;

import com.eastfair.builder.ReportDrawingFeign;
import com.eastfair.core.base.R;
import com.eastfair.core.exception.BizException;
import com.eastfair.home.service.HomeReportDrawingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 报馆图纸feign
 *
 * @author dqq
 * @date 2023 /5/15
 */
@Service
@Slf4j
public class HomeReportDrawingServiceImpl implements HomeReportDrawingService {

    @Resource
    private ReportDrawingFeign reportDrawingFeign;

    @Override
    public boolean getNeedVenueAudit(Long reportSpaceId, Integer isDouble, Integer isPoint) {
        log.info("getNeedVenueAudit - 是否需要场馆审核,reportSpaceId={}, isDouble={}, isPoint={}", reportSpaceId, isDouble, isDouble);
        R<Boolean> result = reportDrawingFeign.getNeedVenueAudit(reportSpaceId, isDouble, isPoint);
        log.info("getNeedVenueAudit - 是否需要场馆审核, result={}", result);
        if (!result.getIsSuccess()) {
            throw BizException.wrap(result.getCode(), result.getMsg());
        }
        return result.getData();
    }
}